package org.dandsoft.blackbox;

import java.io.Serializable;

/**
 * User: dvilyuzhanin
 * Date: 16.01.2009 13:03:55
 */
public class Signal implements Serializable {
    private static final long serialVersionUID = 8458540245220412389L;
    private ObjectId id;
    private Value value;

    public Signal(ObjectId id, Value value) {
        this.id = id;
        this.value = value;
    }

    public ObjectId getId() {
        return id;
    }

    public Value getValue() {
        return value;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Signal signal = (Signal) o;

        if (id != null ? !id.equals(signal.id) : signal.id != null) return false;
        if (value != null ? !value.equals(signal.value) : signal.value != null) return false;

        return true;
    }

    public int hashCode() {
        int result;
        result = (id != null ? id.hashCode() : 0);
        result = 31 * result + (value != null ? value.hashCode() : 0);
        return result;
    }


    public String toString() {
        return "Signal{" +
               "id=" + id +
               ", value=" + value +
               '}';
    }
}
